#include "introsort.c"
int min(int a,int b){
    if (a<b)
       return a;
    return b;
}
int max(int a,int b){
    if (a>b)
       return a;
    return b;
}
#define bool char
#define true 1
#define false 0
bool is_sorted(int base[],int begin,int end,int type){
     /*
     type is 
     1 for strict increasing order
     2 for increasing order
     3 for strict decreasing order
     4 for decreasing order
     */
     int i;
     if (type==1){
        for (i=begin;i<end;++i)
            if (base[i]>=base[i+1])
               return false;
            return true;
     }
     
     if (type==2){
        for (i=begin;i<end;++i)
            if (base[i]>base[i+1])
               return false;
            return true;
     }
     
     if (type==3){
        for (i=begin;i<end;++i)
            if (base[i]<=base[i+1])
               return false;
            return true;
     }
     
     if (type==4){
        for (i=begin;i<end;++i)
            if (base[i]<base[i+1])
               return false;
            return true;
     }
     return false;
}
bool next_permutation(int array[],int left,int right){
     return true;
}
bool prev_permutation(int array[],int left,int right){
     return true;
}
